Add token, AST, and lexer packages for ClickHouse parser#2
Merged
kyleconroy merged 5 commits intomainfrom Dec 12, 2025
Merged
Conversation
Collaborator
kyleconroy
commented
Dec 12, 2025
- token: Define lexical tokens and keywords for ClickHouse SQL
- ast: Define AST node types for statements and expressions
- lexer: Implement tokenizer for ClickHouse SQL syntax
- token: Define lexical tokens and keywords for ClickHouse SQL - ast: Define AST node types for statements and expressions - lexer: Implement tokenizer for ClickHouse SQL syntax
- Implement Parse function taking context and io.Reader - Support SELECT, INSERT, CREATE, DROP, ALTER, TRUNCATE statements - Support USE, DESCRIBE, SHOW, EXPLAIN, SET, OPTIMIZE, SYSTEM - Parse expressions with proper operator precedence - Handle JOINs, subqueries, CTEs, window functions - Support CASE, CAST, EXTRACT, INTERVAL expressions - Parse lambdas, arrays, tuples, and parameters
- Add comprehensive parser tests for SELECT, DDL, and expressions - Test against ClickHouse EXPLAIN AST to verify compatibility - All 39 ClickHouse comparison tests pass - Fix AS alias precedence to properly parse column aliases - Add JSON serialization tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.